package team.xiaobaiya.gptchatrobot.service;

import team.xiaobaiya.gptchatrobot.entity.database.UserKey;

/**
 * @ClassName UserKeyService
 * @Author Feng Yingnan
 * @Email fengyn1211@163.com
 * @Date 2023/4/24 15:44
 */
public interface UserKeyService {
    /**
     * 通过user key查询
     * @param userKey user key
     * @return UserKey
     */
    UserKey selectByUserKey(String userKey);

    /**
     * 用户积分减少1
     * @param userKey user key
     */
    boolean decrementUserUsage(String userKey);

    /**
     * 设置user key正在加载
     * @param userKey user key
     */
    boolean setUserKeyLoading(String userKey);

    /**
     * 设置user key结束正在加载
     * @param userKey user key
     */
    boolean setUserKeyUnloading(String userKey);
}
